# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=libgtop
pkgver=2.40.0+2+g31db82ef
pkgrel=2
pkgdesc="A library for collecting system monitoring data"
url="https://gitlab.gnome.org/GNOME/libgtop"
arch=(x86_64)
license=(LGPL)
depends=(glib2 libxau)
makedepends=(gobject-introspection git gtk-doc)
_commit=31db82efced79d1ceee465d9b50da2fe6fd16482  # master
source=("git+https://gitlab.gnome.org/GNOME/libgtop.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-static --enable-gtk-doc
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
